package com.feicheng.iou.controller;


import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.feicheng.iou.entity.Permission;
import com.feicheng.iou.pojo.UpdateRolePermissionPOJO;
import com.feicheng.iou.pojo.login.PermissionListPOJO;
import com.feicheng.iou.result.ResultInfo;
import com.feicheng.iou.service.PermissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tianchunlei
 * @since 2021-06-28
 */
@RestController
@RequestMapping("/iou/permission")
@Slf4j
public class PermissionController {

    @Autowired
    private PermissionService permissionService; //权限业务实现类

    /**
     * @Author wuweinan
     * @Description //按权限等级嵌套查询所有权限接口
     * @Date 2021/7/28 11:41
     * @Param null
     * @return ResultInfo
     */
    @GetMapping("/list")
    public ResultInfo queryAllPermission(){
        log.info("PermissionController的queryAllPermission方法进入");

        return   permissionService.selectAllPermission();
    }

    /**
     * @Author wuweinan
     * @Description //查询所有权限接口
     * @Date 2021/7/28 11:41
     * @Param null
     * @return ResultInfo
     */
    @GetMapping
    public ResultInfo queryListPermission(){
        log.info("PermissionController的queryListPermission方法进入");
        return  permissionService.selectPermissionList();
    }

}

